package com.japp.manager.service;

import java.io.Serializable;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.japp.base.BaseService;
import com.japp.manager.bean.ErrandBean;
import com.japp.manager.mapper.ErrandMapper;
import com.japp.tools.common.JappLog;
import com.japp.tools.page.Page;

/**
 * 研究报告
 * 
 * @author Administrator
 * 
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class ErrandService implements BaseService {
	@Autowired
	private ErrandMapper errAndMapper;

	public ErrandBean get(Serializable pk) {
		return null;
	}

	public Page<ErrandBean> getPage(Page<ErrandBean> po, ErrandBean obj) {
		try {
			Page<ErrandBean> page = errAndMapper.getPage(po, obj);
			return page;
		} catch (Exception e) {
			JappLog.log.error("", e);
		}
		return null;
	}

	public List<ErrandBean> queryErrandAll() {
		try {
			return errAndMapper.queryErrandAll();
		} catch (Exception e) {
			JappLog.log.error("", e);
		}
		return null;
	}

	public ErrandBean findErrandById(int enId) {
		try {
			return errAndMapper.findErrandById(enId);
		} catch (Exception e) {
			JappLog.log.error("", e);
		}
		return null;
	}

	public int insertErrand(ErrandBean ea) {
		//e.setEn_power((pwoer!=null&&"0".equals(pwoer)?"1":pwoer));
		try {
			int rel = errAndMapper.insertErrand(ea);
			return rel;
		} catch (Exception e) {
			JappLog.log.error("", e);
		}
		return 0;
	}

	public int deleteErrand(String[] keys) {
		try {
			int rel = errAndMapper.deleteErrand(keys);
			return rel;
		} catch (Exception e) {
			JappLog.log.error("", e);
		}
		return 0;
	}
	public int updateErrand(ErrandBean en) {
		try {
			int rel = errAndMapper.updateErrand(en);
			return rel;
		} catch (Exception e) {
			JappLog.log.error("", e);
		}
		return 0;
	}
}
